@RequestMapping("/getPictureForpeople") public void getPictureForpeople(HttpServletRequest request, HttpServletResponse response) throws IOException, SQLException { Connection conn = null; conn = GetJDBCConnection.getJDBCConnection(); Statement stmt = conn.createStatement(); String getPicSQL = "select header from lc0039999.idmidentityinfo where code = 'houzt'"; ResultSet rs = stmt.executeQuery(getPicSQL); Blob img=null; if(rs.next()) { img = rs.getBlob("header"); } long size=img.length(); byte[] bs=img.getBytes(1, (int)size); // response.setContentType("image/jpeg"); ServletOutputStream outs=response.getOutputStream(); outs.write(bs); outs.flush(); }